/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 */

package com.huawei.saashousekeeper.properties;

import com.huawei.saashousekeeper.dbpool.PoolConfig;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 主从对应配置关系
 *
 * @author lWX1156935
 * @since 2022/4/22
 */
@Data
@Accessors(chain = true)
public class MasterSlaveProperty extends PoolConfig {

    /**
     * 数据源组名称，唯一
     */
    private String groupName;

    /**
     * 负载均衡策略  spring.datasource.dynamic.dataSourceMap.groupName1.master.
     * <p>
     * {@link com.huawei.saashousekeeper.config.balancestrategy.LoadBalanceStrategy}
     */
    private String loadBalanceStrategy;

    /**
     * 单主库，有需要可以改为多
     */
    private DataSourceProperty master;

    /**
     * 多从库
     */
    private List<DataSourceProperty> slave;
}
